package com.wy.powerbuilder.controller.Costs;

import com.sun.org.apache.xpath.internal.operations.Mod;
import com.wy.powerbuilder.entity.Costs.temporary;
import com.wy.powerbuilder.entity.hxl.carseat;
import com.wy.powerbuilder.mapper.Costs.TemMapper;
import com.wy.powerbuilder.service.Costs.TemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class TemController {
    @Autowired
    private TemMapper temMapper;
    @Autowired
    private TemService temService;

    //查询
    @RequestMapping("/seltem")
    public String selAll(Model model){
        List<temporary> list=temService.seltemAll();
        model.addAttribute("list",list);
        return "product-category";
    }
    //添加
    @RequestMapping("/addTem")
    public String addTem(temporary temporary){
        temService.addtemp(temporary);
        return "forward:/seltem";
    }

    //根据id查询车牌号是否存在
    @RequestMapping("/getIdCar")
    public String getIdcar(Integer id,Model model){
        carseat getid=new carseat();
        getid=temService.getidTem(id);
        model.addAttribute("getid",getid);
        return "pro-category-add";
    }

//    @RequestMapping("selcarAll")
//    public String selcarAll(Model model){
//        List<carseat> list=temService.selcarAll();
//        model.addAttribute("list",list);
//        return "parkingfee";
//    }
}
